package driver;

import java.util.concurrent.CountDownLatch;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;


/**
 *
 * @author Einsiedler
 */
public class Driver {
    private WebDriver driver;
    
    public Driver(){
        
    }
    /**
     * Creating diver for various browsers
     */
//    public void createdriver(){    
////        driver = new FirefoxDriver();
//        driver = new ChromeDriver();
//        System.out.println("Driver created");
//    }
    ////?????????????
    public WebDriver createdriver(String browsername){
       System.out.println("Create driver");
//       if(driver != null)
//           return driver;
//       else{
//           if (browsername.equals("firefox")){
               driver = new FirefoxDriver();
               driver.get("http://gmail.com");
               return driver;
//           }
//           if (browsername.equals("chrome")){
//               driver = new ChromeDriver();
//               return driver;
//           }
//       }
//       return  driver;
    }

    
    public void closedriver(){
        driver.quit();
    }
}
